import java.nio.file.Path;
import java.lang.String;

import Algo.Algo;
/*	this algorithm return tags according to the file type*/
public class MyAlgo implements Algo{
	public String [] tagFile(Path child){
		
		String tags[]={"xxx"};
		String temp[]=child.toString().split("\\.");
		if (temp[temp.length-1].equals("jpg")||temp[temp.length-1].equals("bmp")||temp[temp.length-1].equals("gif"))
			tags[0]="photo";
		else if (temp[temp.length-1].equals("avi"))
			tags[0]="movie";
		else if (temp[temp.length-1].equals("mp3"))
			tags[0]="music";
		else if (temp[temp.length-1].equals("txt")||temp[temp.length-1].equals("doc"))
			tags[0]="documents";
		else
			tags=null;
		return tags;
	}
	public String descript(){
		return "this algorithm return tags according to the file type";
	}
	public String toString(){
		return "MyAlgo";
	}
}

